package com.xauto.pioneer.appuser.adapter;

import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.xauto.pioneer.appuser.R;
import com.xauto.pioneer.appuser.model.MonthlyRentSiteListInfo;

/**
 * Created by Lemon on 2015/12/11.
 * Desc:订单列表 适配器
 */
public class ParkingRentAdapter extends AbsAdapter<MonthlyRentSiteListInfo> {

    public ParkingRentAdapter(Activity context, int layout) {
        super(context, layout);
    }

    @Override
    public ViewHolder<MonthlyRentSiteListInfo> getHolder() {
        return new TemplateViewHolder();
    }


    private class TemplateViewHolder implements ViewHolder<MonthlyRentSiteListInfo> {

        private TextView tvParkingSite;
        private TextView tvParkingSiteValue;
        private TextView tvParkingSiteAddress;


        @Override
        public void initViews(View v, int position) {
            tvParkingSite = (TextView) v.findViewById(R.id.tvParkingSiteName);
            tvParkingSiteValue = (TextView) v.findViewById(R.id.tvParkingSiteValue);
            tvParkingSiteAddress = (TextView) v.findViewById(R.id.tvParkingSiteAddress);
        }

        @Override
        public void updateData(MonthlyRentSiteListInfo parkingRentSiteInfo, int position) {
            tvParkingSite.setText(parkingRentSiteInfo.parking_name);
            tvParkingSiteValue.setText("剩余车位"+parkingRentSiteInfo.parking_space_num+"个");
            tvParkingSiteAddress.setText(parkingRentSiteInfo.location_message );
        }

        @Override
        public void doOthers(MonthlyRentSiteListInfo orderInfo, int position) {

        }
    }
}
